<?php

;//require_once 'Base/PhotoGalleryRow.php';

/**
 * Generated Model class.
 */
class PhotoGalleryRow extends Base_PhotoGalleryRow implements IContentListElementProvider 
{
	public function getContentListElement($type = null)
	{
		$element = new List_PhotoGallery();
		$element->setText($this->getDescription());
		$element->setViewCount($this->getViewCount());
		$profileRow = $this->getProfileRowByProfileId();
		if ($profileRow) {
			$element->setProfileName($profileRow->getFirstName());
			$element->setProfileUrl('#');
		}
		$p2gRow = $this->getPhoto2galleryRowsetByGalleryId()->current();
		if ($p2gRow) {
			$photoRow = $p2gRow->getPhotoGalleryRowByGalleryId();
			$photoUrl = $photoRow->getUrl();
		}
		$element->setPhoto($photoUrl);
		$element->setDate($this->getDate());
		return $element; 
	}

}

